package com.salt.service;

import com.salt.entity.IdleAffiliatePromotion;
import com.taobao.api.ApiException;
import com.taobao.api.response.*;

import java.util.List;

/**
 * 淘宝API服务接口
 */
public interface TaobaoApiService {
    
    /**
     * 获取商品导览信息
     *
     * @return 商品导览信息
     */
    AlibabaIdleAffiliateMaterialGuideGetResponse getMaterialGuide() throws ApiException;
    
    /**
     * 生成推广链接
     *
     * @param itemId 商品ID
     * @param materialType
     * @return 推广链接信息
     */
    IdleAffiliatePromotion generatePromotionLink(String itemId, Long materialType);

    /**
     * 查询闲鱼联盟物料
     * @param materialType 物料类型
     * @param pageSize 每页数量
     * @param pageNum 页码
     * @param tabName 标签名称
     * @param itemPublisherTime 发布时间
     * @param sellerCreditLevel 卖家信用等级
     * @param filterLevel5Yxp 是否过滤5星好评
     * @param filterYhb 是否过滤已核保
     * @param sellerName 卖家名称
     * @param keyword 关键词
     * @return 物料查询响应
     */
    AlibabaIdleAffiliateMaterialQueryResponse queryMaterials(
        Long materialType,
        Long pageSize,
        Long pageNum,
        String tabName,
        String itemPublisherTime,
        String sellerCreditLevel,
        Boolean filterLevel5Yxp,
        Boolean filterYhb,
        String sellerName,
        String keyword
    ) throws ApiException;
    
    /**
     * 获取闲鱼联盟收入汇总
     */
    AlibabaIdleAffiliateIncomeSummaryResponse getIncomeSummary() throws ApiException;
    
    /**
     * 查询CPS佣金明细
     */
    AlibabaIdleAffiliateCpsIncomeDetailsQueryResponse queryCpsIncomeDetails(
        String createMonth,
        Long billState,
        Long pageSize,
        Long pageNum,
        Long startCreateTimeStamp,
        Long endCreateTimeStamp,
        Long startUpdateTime,
        Long endUpdateTime
    ) throws ApiException;

     AlibabaIdleAffiliateCpsIncomeDetailsSignleQueryResponse queryCpsIncomeDetailsResponse(
            List<String> plainBillId
    ) throws ApiException;


    /**
     * 查询CPA佣金明细
     */
    AlibabaIdleAffiliateCpaIncomeDetailsQueryResponse queryCpaIncomeDetails(
        Long billState,
        Long pageSize,
        Long pageNum,
        Long startTime,
        Long endTime
    ) throws ApiException;
    
    /**
     * 获取CPA收入汇总
     */
    AlibabaIdleAffiliateCpaIncomeSummaryResponse getCpaIncomeSummary() throws ApiException;

    AlibabaIdleAffiliateMaterialExactGetResponse getAndSaveMaterial(String itemId) throws Exception;
} 